package com.itheima.jdk8date;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Demo03 {

    public static void main(String[] args) {

        LocalDateTime now = LocalDateTime.now();
        String s = now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss"));
        System.out.println(s);
        String str="2011-11-11 11:11:11";
        LocalDateTime datetime = LocalDateTime.parse(str, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        System.out.println(datetime);


    }
}
